﻿using System;
using Pay.TO;
using System.Collections.Generic;

namespace Pay.DTO {
    /// <summary>
    /// 商城支付请求报文
    /// </summary>
    [Serializable]
    public class mall_model : head_req {
        /// <summary>
        /// 初始化对象
        /// </summary>
        public mall_model() {
            orders = new List<order_dto>();
			req_method = 1;
        }
        /// <summary>
        /// 购买来源 0立即购买 1购物车结算 3 集市 4 实人认证
        /// </summary>
        public int source_type { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 订单金额,分为单位
        /// </summary>
        public string tran_amount { get; set; }
        /// <summary>
        /// 商品描述
        /// </summary>
        public string body { get; set; }
        /// <summary>
        /// 商品的标题，该参数最长为 32 个  字符，京东支付、网关支付、快捷支付、QQ钱包为必填
        /// </summary>
        public string subject { get; set; }
        /// <summary>
        /// 支付成功后服务器回调该地址
        /// </summary>
        public string notify { get; set; }
		/// <summary>
		/// 同步通知地址
		/// </summary>
		public string front_notify { get; set; }
        /// <summary>
        /// 通道
        /// </summary>
        public PayChannel pay_channel { get; set; }
        /// <summary>
        /// 支付方式：微信扫码支付WXPAY_QR，支付宝扫码支付ALIPAY_QR，京东扫码支付JDPAY_QR,银联扫码支付UNIONPAY_QR，QQ钱包扫码支付QQ_QR，
        /// 微信付款码支付WXPAY_MICRO,支付宝款码支付ALIPAY_MICRO,
        /// 微信APP支付WXPAY_APP,支付宝APP支付ALIPAY_APP,
        /// 微信公众账号支付WXPAY_JS,支付宝服务窗支付ALIPAY_JS,
        /// </summary>
        public string pay_code { get; set; }
        /// <summary>
        /// 结算方式：T0,T1
        /// </summary>
        public string settle_type { get; set; }
        /// <summary>
        /// 支付类型：不要给APP调用
        /// </summary>
        public PayType pay_type { get; set; }
        /// <summary>
        /// 类型：收款1，升级2，订单3：不要给APP调用
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 微信公众账号支付：子商户公众号下关注的用户openid
        /// </summary>
        public string openid { get; set; }
        /// <summary>
        /// 支付渠道返回的订单号：不要给APP调用
        /// </summary>
        public string transaction_no { get; set; }
        /// <summary>
        /// 订单数据
        /// </summary>
        public List<order_dto> orders { get; set; }
        /// <summary>
        /// 配送方式 1：物流 ，2：到店拿货，3：送货上门 4：无配送
        /// </summary>
        public int shipping_type { get; set; }
        /// <summary>
        /// 收货地址
        /// </summary>
        public shipping_model shipping { get; set; }
		/// <summary>
		/// 1:app,2:h5
		/// </summary>
		public int req_method { get; set; }
        /// <summary>
        /// 是否是微信公众号支付
        /// </summary>
        public bool is_wx_pub_account_pay { get; set; }
    }

    /// <summary>
    /// 创建订单的响应
    /// </summary>
    [Serializable]
    public class order_create_result {
        /// <summary>
        /// 单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public OrderStatus status { get; set; }
        /// <summary>
        /// 付款金额
        /// </summary>
        public decimal pay_amount { get; set; }
    }

    public class mall_result : ApiResultMessage {
        /// <summary>
        /// 二维码串:交易类型为WXPAY_QR、ALIPAY_QR时有返回
        /// </summary>
        public string code_url { get; set; }
        /// <summary>
        /// 以下交易类型时有返回WXPAY_APP(WXPAY_APP返回json字符串组成，用户根据返回参数直接调用微信sdk进行支付)
        /// </summary>
        public string pay_info { get; set; }
        /// <summary>
        /// 商户订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 支付渠道返回的订单号
        /// </summary>
        public string transaction_no { get; set; }
        /// <summary>
        /// 是否调起支付
        /// </summary>
        public bool is_open { get; set; }
    }
    public class mall_h5_result : result_base {
        /// <summary>
        /// 二维码串:交易类型为WXPAY_QR、ALIPAY_QR时有返回
        /// </summary>
        public string code_url { get; set; }
        /// <summary>
        /// 以下交易类型时有返回WXPAY_APP(WXPAY_APP返回json字符串组成，用户根据返回参数直接调用微信sdk进行支付)
        /// </summary>
        public string pay_info { get; set; }
        /// <summary>
        /// 商户订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 支付渠道返回的订单号
        /// </summary>
        public string transaction_no { get; set; }
        /// <summary>
        /// 是否调起支付
        /// </summary>
        public bool is_open { get; set; }
    }
}
